package com.supermap.business.cloud.mymine;

import com.alibaba.dubbo.config.annotation.Reference;
import com.supermap.dataservice.util.JSONUtils;
import com.supermap.dubbo.api.cloud.mymine.MymineService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @author aqua
 * @description
 * @date 2019年12月12 15:55
 * @email 1301584033@qq.com
 */
@Controller
@RequestMapping("/cloud/mymine")
public class MymineController {
    @Reference(timeout = 100000)
    private MymineService mymineService;
    //功能点击
    @GetMapping("/getFarmList")
    @ResponseBody
    public JSONUtils getFarmList(String areaCode,Integer userId,Integer limit){
        return  mymineService.getFarmList(areaCode,userId,limit);
    }


    //菜单查询功能
    @GetMapping("/getNewAreaRoleMenu")
    @ResponseBody
    public JSONUtils getNewAreaRoleMenu(Integer userId){
        return  mymineService.getNewAreaRoleMenu(userId);
    }

    //添加菜单
    @PutMapping("/putNewMenu")
    @ResponseBody
    public JSONUtils putNewMenu(Integer userId,String menuCode){
        return  mymineService.putNewMenu(userId,menuCode);
    }

    //取消菜单
    @DeleteMapping("/delNewMenu")
    @ResponseBody
    public JSONUtils delNewMenu(Integer userId,String menuCode){
        return  mymineService.delNewMenu(userId,menuCode);
    }

    //获取作物
    @GetMapping("/getNewCorpList")
    @ResponseBody
    public JSONUtils getNewCorpList(Integer userId){
        return  mymineService.getNewCorpList(userId);
    }

    //添加作物
    @PutMapping("/putNewCrop")
    @ResponseBody
    public JSONUtils putNewCrop(Integer userId,Integer cropId){
        return  mymineService.putNewCrop(userId,cropId);
    }

    //取消作物
    @DeleteMapping("/delNewCrop")
    @ResponseBody
    public JSONUtils delNewCrop(Integer userId,Integer cropId){
        return  mymineService.delNewCrop(userId,cropId);
    }

    //门户网站
    @GetMapping("/getUrl")
    @ResponseBody
    public JSONUtils getUrl(Integer userId){
        return  mymineService.getUrl(userId);
    }
    @GetMapping("/getUserScore")
    @ResponseBody
    public   JSONUtils getUserScore(Integer userId){
        return  mymineService.getUserScore(userId);
    }

    //个人积分
}
